<?
$pageName = "changePassword";
/**
 * @var $includePath
 */
include $includePath . 'header.php';
?>

<div class="container">
<div class="page-header">
	<br /><br />
	<? if(isset($succ)) { ?><div class="alert alert-success" role="alert">操作成功！</div><? }?>
	<h2><label>修改密码</label></h2>
</div>
<div class="row" style="margin-bottom:20px;">
	<form class="form-horizontal" role="form" method="post">
		<div class="col-xs-10">
			<?
				$data['原密码'] = 'originPassword';
				$data['新密码'] = 'newPassword';
				$data['确认新密码'] = 'newPasswordCheck';
				foreach ($data as $key => $value) {
			?>
			<div class="form-group">
				<label class="col-sm-3 control-label"><?=$key?></label>
				<div class="col-sm-9">
					<input id="<?=$value?>" name="<?=$value?>" type="password" class="form-control input-sm" />
				</div>
			</div>
			<?}?>
		</div>
		<p>&nbsp;</p>
		<div class="form-group">
			<div class="col-sm-offset-5 col-sm-2">
				<button type="submit" class="btn btn-danger btn-lg btn-block" onclick="return checkNewPassword();">提交！</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	function checkNewPassword() {
		var newPassword = document.getElementById('newPassword');
		var newPasswordCheck = document.getElementById('newPasswordCheck');
		if (newPassword.value.length < 6) {
			alert('新密码长度不能小于6位！');
			return false;
		}
		if (newPassword.value != newPasswordCheck.value) {
			alert('两次输入的新密码不一致！');
			return false;
		}
		return true;
	}
</script>
<? include ROOT . '/view/common/footer.php'; ?>